<template>
  <div class="container-fluid" v-loading="loading">
    <div class="row mga padds">
      <div class="col">
        <div class="container-fluid">
          <div class="row color-btn">
            <ul class="nav">
              <li class="nav-item">
                <router-link class="nav-link" :to="{ name: 'myinfo' }">个人信息</router-link>
              </li>
              <li class="nav-item">
                <router-link class="nav-link" :to="{ name: 'mypasswold' }">更改密码</router-link>
              </li>
              <li class="nav-item">
                <router-link class="nav-link" :to="{ name: 'mywx' }">绑定账号</router-link>
              </li>
              <li class="nav-item">
                <router-link class="nav-link" :to="{ name: 'mymedal' }">勋章</router-link>
              </li>
              <li class="nav-item">
                <router-link
                  class="nav-link"
                  :to="{ name: 'myuser' }"
                  v-if="getuser.userType != 'User'"
                >子用户管理</router-link>
              </li>
              <li class="nav-item">
                <router-link
                  class="nav-link"
                  :to="{ name: 'myinvitation' }"
                  v-if="getuser.userType != 'User'"
                >邀请码</router-link>
              </li>
              <li class="nav-item">
                <router-link
                  class="nav-link"
                  :to="{ name: 'Avatar' }"
                >更换头像</router-link>
              </li>
            </ul>
          </div>
          <router-view v-if="loading2"></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapActions, mapGetters } from "vuex";
export default {
  data() {
    return {
      loading: false,
      loading2: true
    };
  },
  async mounted() {
    this.loading = true;
    if (this.getuser.userType != "User") {
      await this.actionagentUser();
      await this.actionagentInvite();
    }
    this.loading = false;
    this.loading2 = true;
  },
  computed: mapGetters(["getuser"]),
  methods: {
    ...mapActions(["actionagentUser", "actionagentInvite"])
  }
};
</script>


<style scoped>
.h3 {
  height: 18px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #2f81f1;
}
.mga {
  background-color: #ffffff;
  box-shadow: 0px 0px 21px 0px rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  padding: 20px;
  min-height: 200px;
  font-family: MicrosoftYaHei-Bold;
}
.tecenter {
  line-height: 120px;
  color: #333333;
  font-size: 16px;
}
.nav-link {
  color: #333333;
  margin-right: 21px;
}
.router-link-active {
  color: #2f81f1;
}
.color-btn {
  padding-bottom: 15px;
  border-bottom: 1px solid #f3f3f3;
  margin-bottom: 30px;
}
</style>
